package edu.mobbuzz.rss.reader;

import java.util.Date;

import com.sun.syndication.feed.synd.SyndEntryImpl;

public class FeedEntry {  
	Date pubdate;  
	SyndEntryImpl entry;  
	String author, description, link, title;  
	public String newline = System.getProperty("line.separator");  
   
	public FeedEntry(SyndEntryImpl _entry) {  
		try {  
			entry=_entry;  			
	    }  
	    catch(Exception e) {  
	    	System.out.println("Exception in FeedEntry: "+e.toString());  
	    	e.printStackTrace();  
	    }  
   
	}  
	   
	public SyndEntryImpl getEntry() {
		return entry;
	}

	public void setEntry(SyndEntryImpl entry) {
		this.entry = entry;
	}

	public String getAuthor() {
		author = getEntry().getAuthor();
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getDescription() {
		description = getEntry().getDescription().getValue();
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getLink() {
		link = getEntry().getLink();
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getTitle() {
		title = getEntry().getTitle();
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	
	public Date getPubdate() {
		pubdate = getEntry().getPublishedDate();
		return pubdate;
	}

	public void setPubdate(Date pubdate) {
		this.pubdate = pubdate;
	}

	public String toString() {  
		   
	   String s;  
   
	   s="Title: "+getTitle()+newline+  
       	 "URL: "+getLink()+newline+  
       	 "Date: "+getPubdate().toString()+newline+getDescription()+newline;  
   
	   return s;  
   }  
}  
